﻿namespace ICommonLibrary.Service {

    public class ServiceState {

        public const int Uninitialized = 1;
        public const int Initialized = 2;
        public const int Started = 3;
        public const int Stopped = 4;
        public const int Destroyed = 5;

        public int Code { get; set; }
        public string Message { get; set; }

        public ServiceState() {
            Set(Uninitialized, string.Empty);
        }

        public void Set(int code, string msg) {
            Code = code;
            Message = msg;
        }

        public void SetInitialized(string msg) {
            Set(Initialized, msg);
        }

        public void SetStarted(string msg) {
            Set(Started, msg);
        }

        public void SetStopped(string msg) {
            Set(Stopped, msg);
        }

        public void SetDestroyed(string msg) {
            Set(Destroyed, msg);
        }

    }
}